home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / TheBearsAdventure.swf / scripts / frame_6 / PlaceObject2_1241_211 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-04  |  34.9 KB  |  841 lines

  1. onClipEvent(enterFrame){
  2.    if(_visible)
  3.    {
  4.       if(_Y > 611)
  5.       {
  6.          _Y = 0;
  7.       }
  8.       if(sost == 10)
  9.       {
  10.          if(_currentframe < frame_fall || _currentframe > frame_fall_last)
  11.          {
  12.             gotoAndPlay(frame_fall);
  13.          }
  14.          if(_Y < start_y)
  15.          {
  16.             _Y = _Y + world_fall_speed;
  17.          }
  18.          else
  19.          {
  20.             _Y = start_y;
  21.             sost = 1;
  22.             ai_sost = 2;
  23.             turn_count = max_turn_count;
  24.          }
  25.       }
  26.       else if(sost == 9)
  27.       {
  28.          if(_currentframe < frame_dead || _currentframe > frame_dead_last)
  29.          {
  30.             gotoAndPlay(frame_dead);
  31.          }
  32.          if(dead_count < 43)
  33.          {
  34.             dead_count++;
  35.             if(dead_count == 32)
  36.             {
  37.                if(!_level0.no_sound)
  38.                {
  39.                   _level0.snds[_level0.snd_frozen_explode].start();
  40.                }
  41.             }
  42.          }
  43.          else
  44.          {
  45.             _level0.snowball_count = _level0.snowball_count + 1;
  46.             _level0.bonus.duplicateMovieClip("bonus" + _level0.snowball_count,1000 + _level0.snowball_count);
  47.             do
  48.             {
  49.                bonus = random(8) + 1;
  50.             }
  51.             while(bonus == 4);
  52.             
  53.             eval("_level0.bonus" + _level0.snowball_count).gotoAndStop(bonus);
  54.             eval("_level0.bonus" + _level0.snowball_count)._x = _X;
  55.             eval("_level0.bonus" + _level0.snowball_count)._y = _Y;
  56.             eval("_level0.bonus" + _level0.snowball_count)._visible = true;
  57.             if(super_bonus)
  58.             {
  59.                super_bonus = false;
  60.                if(!_level0.no_sound)
  61.                {
  62.                   _level0.snds[_level0.snd_greatkick].start();
  63.                }
  64.                var i = 1;
  65.                while(eval("_level0.L" + _level0.global_level + "_bonus" + i + "i") !== undefined)
  66.                {
  67.                   _level0.snowball_count = _level0.snowball_count + 1;
  68.                   _level0.bonus.duplicateMovieClip("bonus" + _level0.snowball_count,1000 + _level0.snowball_count);
  69.                   eval("_level0.bonus" + _level0.snowball_count).gotoAndStop(4);
  70.                   eval("_level0.bonus" + _level0.snowball_count)._x = Number(eval("_level0.L" + _level0.global_level + "_bonus" + i + "i")) * 40 + 20;
  71.                   eval("_level0.bonus" + _level0.snowball_count)._y = (- (13 - Number(eval("_level0.L" + _level0.global_level + "_bonus" + i + "j")))) * 40;
  72.                   eval("_level0.bonus" + _level0.snowball_count).start_y = Number(eval("_level0.L" + _level0.global_level + "_bonus" + i + "j")) * 40 + 12;
  73.                   eval("_level0.bonus" + _level0.snowball_count)._visible = true;
  74.                   i++;
  75.                }
  76.             }
  77.             this.removeMovieClip();
  78.          }
  79.       }
  80.       else if(sost == 8 && knock_index != undefined)
  81.       {
  82.          if(knock_index < knock_speed_y.length)
  83.          {
  84.             dy = - knock_speed_y[knock_index];
  85.          }
  86.          else if(knock_index < knock_speed_y.length * 2)
  87.          {
  88.             dy = knock_speed_y[knock_speed_y.length * 2 - knock_index - 1];
  89.          }
  90.          else
  91.          {
  92.             dy = knock_speed_y[0];
  93.          }
  94.          knock_index++;
  95.          if(_Y + dy >= 0)
  96.          {
  97.             _Y = _Y + dy;
  98.          }
  99.          else if(knock_index < knock_speed_y.length)
  100.          {
  101.             knock_index = knock_speed_y.length;
  102.          }
  103.          if(_xscale < 0)
  104.          {
  105.             if(_X <= 21)
  106.             {
  107.                _X = 21 + knock_speed_x;
  108.                _xscale = - _xscale;
  109.             }
  110.             else if(_level0.pole[Math.floor(_Y / 40)][Math.floor((_X - 8 - knock_speed_x) / 40)] != 0 && _level0.pole[Math.floor(_Y / 40)][Math.floor((_X - 8) / 40)] == 0)
  111.             {
  112.                _xscale = - _xscale;
  113.             }
  114.             else
  115.             {
  116.                _X = _X - knock_speed_x;
  117.             }
  118.          }
  119.          else if(_X >= 781)
  120.          {
  121.             _X = 781 - knock_speed_x;
  122.             _xscale = - _xscale;
  123.          }
  124.          else if(_level0.pole[Math.floor(_Y / 40)][Math.floor((_X + 6 + knock_speed_x) / 40)] != 0 && _level0.pole[Math.floor(_Y / 40)][Math.floor((_X + 6) / 40)] == 0)
  125.          {
  126.             _xscale = - _xscale;
  127.          }
  128.          else
  129.          {
  130.             _X = _X + knock_speed_x;
  131.          }
  132.          cy = Math.floor((_Y + 29) / 40);
  133.          cx0 = Math.floor((_X - 8) / 40);
  134.          cx1 = Math.floor((_X + 6) / 40);
  135.          if(knock_index > knock_speed_y.length && (_level0.pole[cy][cx0] != 0 || _level0.pole[cy][cx1] != 0) && (_level0.pole[Math.floor((_Y + 29 - dy) / 40)][cx0] == 0 || _level0.pole[Math.floor((_Y + 29 - dy) / 40)][cx1] == 0))
  136.          {
  137.             if(random(2) == 0 || knock_skip || cy > 10)
  138.             {
  139.                if(_level0.pole[cy][cx1] == 3)
  140.                {
  141.                   dx = _X + 6 - cx1 * 40;
  142.                   _Y = cy * 40 + 8 - dx;
  143.                }
  144.                else if(_level0.pole[cy][cx0] == 4)
  145.                {
  146.                   dx = _X - 8 - cx0 * 40;
  147.                   _Y = cy * 40 + dx - 30;
  148.                }
  149.                else
  150.                {
  151.                   _Y = cy * 40 - 29;
  152.                }
  153.                sost = 9;
  154.                dead_count = 0;
  155.                gotoAndPlay(frame_dead);
  156.             }
  157.             else
  158.             {
  159.                knock_skip = true;
  160.             }
  161.          }
  162.       }
  163.       else
  164.       {
  165.          found = false;
  166.          land = false;
  167.          if(sost == 3)
  168.          {
  169.             if((_currentframe < frame_fall || _currentframe > frame_fall_last) && ai_sost != 9)
  170.             {
  171.                gotoAndPlay(frame_fall);
  172.             }
  173.             fall_speed = world_fall_speed;
  174.             cy = Math.floor((_Y + 28 + fall_speed) / 40);
  175.             cx0 = Math.floor((_X - 8) / 40);
  176.             cx1 = Math.floor((_X + 6) / 40);
  177.             if(_Y > 0 && _level0.pole[cy][cx1] == 3)
  178.             {
  179.                dx = _X + 6 - cx1 * 40;
  180.                if(_Y + fall_speed < cy * 40 + 8 - dx || jumpdown)
  181.                {
  182.                   _Y = _Y + fall_speed;
  183.                   fall_count += fall_speed;
  184.                }
  185.                else
  186.                {
  187.                   _Y = cy * 40 + 8 - dx;
  188.                   if(ai_sost == 9 && snow_ball && fall_count >= fall_count_jump)
  189.                   {
  190.                      sost = 2;
  191.                      jump_index = 2;
  192.                      fall_count = 0;
  193.                   }
  194.                   else
  195.                   {
  196.                      sost = 1;
  197.                      land = true;
  198.                   }
  199.                }
  200.                found = true;
  201.             }
  202.             else if(_Y > 0 && _level0.pole[cy][cx0] == 4)
  203.             {
  204.                dx = _X - 8 - cx0 * 40;
  205.                if(_Y + fall_speed < cy * 40 + dx - 30 || jumpdown)
  206.                {
  207.                   _Y = _Y + fall_speed;
  208.                   fall_count += fall_speed;
  209.                }
  210.                else
  211.                {
  212.                   _Y = cy * 40 + dx - 30;
  213.                   if(ai_sost == 9 && snow_ball && fall_count >= fall_count_jump)
  214.                   {
  215.                      sost = 2;
  216.                      jump_index = 2;
  217.                      fall_count = 0;
  218.                   }
  219.                   else
  220.                   {
  221.                      sost = 1;
  222.                      land = true;
  223.                   }
  224.                }
  225.                found = true;
  226.             }
  227.             if(!found)
  228.             {
  229.                if(_Y < 0 || Math.floor((_Y + 28) / 40) == Math.floor((_Y + 28 + world_fall_speed) / 40))
  230.                {
  231.                   _Y = _Y + world_fall_speed;
  232.                   fall_count += world_fall_speed;
  233.                   if(jumpdownend && _level0.pole[Math.floor((_Y + 28) / 40)][Math.floor(_X / 40)] == 0)
  234.                   {
  235.                      jumpdown = false;
  236.                      ai_sost = 1;
  237.                   }
  238.                   if(jumpdown && _level0.pole[Math.floor((_Y + 28) / 40)][Math.floor(_X / 40)] != 0)
  239.                   {
  240.                      jumpdownend = true;
  241.                   }
  242.                }
  243.                else
  244.                {
  245.                   var fall_speed = world_fall_speed;
  246.                   while(fall_speed > 0)
  247.                   {
  248.                      cy = Math.floor((_Y + 28 + fall_speed) / 40);
  249.                      cx0 = Math.floor((_X - 8) / 40);
  250.                      cx1 = Math.floor((_X + 6) / 40);
  251.                      if(_Y > 520 || jumpdown || _level0.pole[cy][cx0] == 0 && _level0.pole[cy][cx1] == 0)
  252.                      {
  253.                         _Y = _Y + fall_speed;
  254.                         fall_count += fall_speed;
  255.                         break;
  256.                      }
  257.                      if(ai_sost == 9 && snow_ball && fall_count >= fall_count_jump)
  258.                      {
  259.                         sost = 2;
  260.                         jump_index = 2;
  261.                         fall_count = 0;
  262.                         break;
  263.                      }
  264.                      sost = 1;
  265.                      land = true;
  266.                      if(plus_mode && ai_sost != 8 && ai_sost != 9)
  267.                      {
  268.                         ai_sost = 1;
  269.                         if(_level0.hero._x < _X && _xscale > 0 && (_level0.hero.sost != 4 && _level0.hero.sost != 9 && _level0.hero.sost != 10) || _level0.hero._x > _X && _xscale < 0 && (_level0.hero.sost != 4 && _level0.hero.sost != 9 && _level0.hero.sost != 10))
  270.                         {
  271.                            ai_sost = 2;
  272.                            turn_count = max_turn_count;
  273.                         }
  274.                      }
  275.                      fall_speed--;
  276.                   }
  277.                }
  278.             }
  279.          }
  280.          if(sost == 1)
  281.          {
  282.             var i = 1;
  283.             while(i <= _level0.num_monsters)
  284.             {
  285.                if(eval("_level0.monster" + i) != undefined && "/monster" + i != _target)
  286.                {
  287.                   if(eval("_level0.monster" + i).sost != 8 && eval("_level0.monster" + i).sost != 9 && eval("_level0.monster" + i).sost != 10 && eval("_level0.monster" + i).ai_sost != 2 && (_X + 10 >= eval("_level0.monster" + i)._x - 27 && _X - 12 <= eval("_level0.monster" + i)._x + 25 && (_Y + 28 >= eval("_level0.monster" + i)._y - 8 && _Y - 8 <= eval("_level0.monster" + i)._y + 28)))
  288.                   {
  289.                      if(eval("_level0.monster" + i)._xscale == _xscale && ai_sost != 9 && ai_sost != 2)
  290.                      {
  291.                         ai_sost = 2;
  292.                         turn_count = max_turn_count;
  293.                         break;
  294.                      }
  295.                   }
  296.                }
  297.                i++;
  298.             }
  299.          }
  300.          if(sost == 2 && jump_index != undefined)
  301.          {
  302.             _Y = _Y - jump_speed[jump_index];
  303.             jump_index++;
  304.             var i = 1;
  305.             while(i <= _level0.num_monsters)
  306.             {
  307.                if(eval("_level0.monster" + i) != undefined && "/monster" + i != _target)
  308.                {
  309.                   if(eval("_level0.monster" + i).sost != 8 && eval("_level0.monster" + i).sost != 9 && eval("_level0.monster" + i).sost != 10 && (_X + 10 >= eval("_level0.monster" + i)._x - 27 && _X - 12 <= eval("_level0.monster" + i)._x + 25 && (_Y - 16 >= eval("_level0.monster" + i)._y - 8 && _Y - 16 <= eval("_level0.monster" + i)._y + 28)))
  310.                   {
  311.                      eval("_level0.monster" + i).sost = 2;
  312.                      eval("_level0.monster" + i).jump_index = 2;
  313.                      eval("_level0.monster" + i).fall_count = 0;
  314.                      break;
  315.                   }
  316.                }
  317.                i++;
  318.             }
  319.             if(jump_index >= jump_speed.length)
  320.             {
  321.                jump_index = undefined;
  322.                sost = 3;
  323.                if(ai_sost != 8 && ai_sost != 9)
  324.                {
  325.                   ai_sost = 1;
  326.                }
  327.             }
  328.          }
  329.          dx = 0;
  330.          dy = 0;
  331.          if(_level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X - 12) / 40)] == 4 || _level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X + 10) / 40)] == 4 && sost == 1)
  332.          {
  333.             dx = 2;
  334.             dy = 2;
  335.          }
  336.          else if(_level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X - 12) / 40)] == 3 || _level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X + 10) / 40)] == 3 && sost == 1)
  337.          {
  338.             dx = -2;
  339.             dy = 2;
  340.          }
  341.          if(dx != 0 && dy != 0)
  342.          {
  343.             var found_monster = false;
  344.             var i = 1;
  345.             while(i <= _level0.num_monsters)
  346.             {
  347.                if(eval("_level0.monster" + i) != undefined && "/monster" + i != _target)
  348.                {
  349.                   if(eval("_level0.monster" + i).sost != 8 && eval("_level0.monster" + i).sost != 9 && eval("_level0.monster" + i).sost != 10 && (_Y + 28 + dy >= eval("_level0.monster" + i)._y - 11 && _Y - 11 + dy <= eval("_level0.monster" + i)._y + 28) && !(eval("_level0.monster" + i).ai_sost == 9 && !eval("_level0.monster" + i).snow_ball))
  350.                   {
  351.                      right = false;
  352.                      left = false;
  353.                      if(_X + 10 + dx + speed >= eval("_level0.monster" + i)._x - 27 && _X + 10 + dx <= eval("_level0.monster" + i)._x - 27)
  354.                      {
  355.                         right = true;
  356.                      }
  357.                      if(_X - 12 + dx >= eval("_level0.monster" + i)._x + 25 && _X - 12 + dx - speed <= eval("_level0.monster" + i)._x + 25)
  358.                      {
  359.                         left = true;
  360.                      }
  361.                      if(right || left)
  362.                      {
  363.                         if(ai_sost != 9 && ai_sost != 2 && (right && _xscale > 0 || left && _xscale < 0))
  364.                         {
  365.                            ai_sost = 2;
  366.                            turn_count = max_turn_count;
  367.                         }
  368.                         dx = 0;
  369.                         dy = 0;
  370.                         break;
  371.                      }
  372.                   }
  373.                }
  374.                i++;
  375.             }
  376.             _X = _X + dx;
  377.             _Y = _Y + dy;
  378.          }
  379.          else if(!found)
  380.          {
  381.             if(sost == 1)
  382.             {
  383.                if(_Y > 520 || _level0.pole[Math.floor((_Y + 29) / 40)][Math.floor((_X - 8) / 40)] == 0 && _level0.pole[Math.floor((_Y + 29) / 40)][Math.floor((_X + 6) / 40)] == 0)
  384.                {
  385.                   sost = 3;
  386.                   if(ai_sost != 9)
  387.                   {
  388.                      ai_sost = 1;
  389.                   }
  390.                }
  391.                else
  392.                {
  393.                   if(ai_sost == 9 && snow_ball && fall_count >= fall_count_jump)
  394.                   {
  395.                      sost = 2;
  396.                      jump_index = 0;
  397.                   }
  398.                   else
  399.                   {
  400.                      sost = 1;
  401.                   }
  402.                   fall_count = 0;
  403.                }
  404.             }
  405.          }
  406.          switch(ai_sost)
  407.          {
  408.             case 9:
  409.                if(frozen_count > 0)
  410.                {
  411.                   if(snow_ball && (_currentframe < frame_ball || _currentframe > frame_ball_last))
  412.                   {
  413.                      gotoAndPlay(frame_ball);
  414.                   }
  415.                   if(snow_ball_hit && !snow_ball)
  416.                   {
  417.                      gotoAndPlay(frame_frozen_last - frozen_count);
  418.                      snow_ball_hit = false;
  419.                      snow_ball_move = false;
  420.                   }
  421.                   frozen_count--;
  422.                   if(frozen_count > 99)
  423.                   {
  424.                      snow_ball = true;
  425.                   }
  426.                   else
  427.                   {
  428.                      gotoAndPlay(frame_frozen_last - frozen_count);
  429.                      snow_ball = false;
  430.                      snow_ball_move = false;
  431.                   }
  432.                }
  433.                else
  434.                {
  435.                   ai_sost = 8;
  436.                   wet_count = 16;
  437.                   snow_ball = false;
  438.                   snow_ball_move = false;
  439.                }
  440.             case 1:
  441.                if(sost == 1 || sost == 2 && jump_side)
  442.                {
  443.                   if(ai_sost == 1)
  444.                   {
  445.                      speed = 10;
  446.                   }
  447.                   if(ai_sost == 9)
  448.                   {
  449.                      speed = 4;
  450.                   }
  451.                   if(_xscale < 0)
  452.                   {
  453.                      if(_X <= 21)
  454.                      {
  455.                         if(ai_sost != 9)
  456.                         {
  457.                            ai_sost = 2;
  458.                            turn_count = max_turn_count;
  459.                         }
  460.                      }
  461.                      else if(_Y < 0)
  462.                      {
  463.                         sost = 3;
  464.                      }
  465.                      else
  466.                      {
  467.                         var found_monster = false;
  468.                         if(_level0.pole[Math.floor((_Y + 28 - speed) / 40)][Math.floor((_X - 8 - speed) / 40)] == 4)
  469.                         {
  470.                            dy = - speed;
  471.                         }
  472.                         else if(_level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X - 8 - speed) / 40)] == 3)
  473.                         {
  474.                            dy = speed;
  475.                         }
  476.                         else if(_level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X - 8 - speed) / 40)] == 4)
  477.                         {
  478.                            dy = - speed;
  479.                         }
  480.                         else
  481.                         {
  482.                            dy = 0;
  483.                         }
  484.                         var i = 1;
  485.                         while(i <= _level0.num_monsters)
  486.                         {
  487.                            if(eval("_level0.monster" + i) != undefined && "/monster" + i != _target)
  488.                            {
  489.                               if(eval("_level0.monster" + i).sost != 8 && eval("_level0.monster" + i).sost != 9 && eval("_level0.monster" + i).sost != 10 && (_Y + 28 + dy >= eval("_level0.monster" + i)._y - 11 && _Y - 11 <= eval("_level0.monster" + i)._y + 28) && !(eval("_level0.monster" + i).ai_sost == 9 && !eval("_level0.monster" + i).snow_ball))
  490.                               {
  491.                                  right = false;
  492.                                  left = false;
  493.                                  if(_X + 10 + speed >= eval("_level0.monster" + i)._x - 27 && _X + 10 <= eval("_level0.monster" + i)._x - 27)
  494.                                  {
  495.                                     right = true;
  496.                                  }
  497.                                  if(_X - 12 >= eval("_level0.monster" + i)._x + 25 && _X - 12 - speed <= eval("_level0.monster" + i)._x + 25)
  498.                                  {
  499.                                     left = true;
  500.                                  }
  501.                                  if(right || left)
  502.                                  {
  503.                                     if(ai_sost != 9 && ai_sost != 2 && left)
  504.                                     {
  505.                                        ai_sost = 2;
  506.                                        turn_count = max_turn_count;
  507.                                        found_monster = true;
  508.                                        break;
  509.                                     }
  510.                                  }
  511.                               }
  512.                            }
  513.                            i++;
  514.                         }
  515.                         if(!found_monster)
  516.                         {
  517.                            if(_level0.pole[Math.floor((_Y + 28 - speed) / 40)][Math.floor((_X - 8 - speed) / 40)] == 4 || _level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X - 8) / 40)] == 4)
  518.                            {
  519.                               if(ai_sost != 9 || move_snow_ball)
  520.                               {
  521.                                  _X = _X - speed;
  522.                                  _Y = _Y - speed;
  523.                                  move_snow_ball = false;
  524.                               }
  525.                            }
  526.                            else
  527.                            {
  528.                               cx = Math.floor((_X - 8 - speed) / 40);
  529.                               cy = Math.floor((_Y + 28) / 40);
  530.                               switch(_level0.pole[cy][cx])
  531.                               {
  532.                                  case 0:
  533.                                  case 1:
  534.                                     if(ai_sost != 9 || move_snow_ball)
  535.                                     {
  536.                                        if(_level0.pole[Math.floor((_Y + 28 + speed) / 40)][Math.floor((_X + 6) / 40)] == 3)
  537.                                        {
  538.                                           _Y = _Y + speed;
  539.                                        }
  540.                                        _X = _X - speed;
  541.                                        move_snow_ball = false;
  542.                                     }
  543.                                     break;
  544.                                  case 2:
  545.                                     if(ai_sost != 9)
  546.                                     {
  547.                                        if(cy >= 2 && sost != 2 && (_level0.pole[cy - 1][cx] == 0 || _level0.pole[cy - 2][cx] == 0) && (random(2) == 0 || _level0.hero.sost != 3 && Math.round((_level0.hero._y + 28) / 40) + 1 < cy))
  548.                                        {
  549.                                           if(_currentframe < frame_jump || _currentframe > frame_jump_last)
  550.                                           {
  551.                                              gotoAndPlay(frame_jump);
  552.                                           }
  553.                                           jump_index = 0;
  554.                                           sost = 2;
  555.                                           jump_side = true;
  556.                                        }
  557.                                        else if(!jump_side)
  558.                                        {
  559.                                           ai_sost = 2;
  560.                                           turn_count = max_turn_count;
  561.                                        }
  562.                                     }
  563.                                     break;
  564.                                  case 3:
  565.                                     if(ai_sost != 9 || move_snow_ball)
  566.                                     {
  567.                                        _X = _X - speed;
  568.                                        _Y = _Y + speed;
  569.                                        move_snow_ball = false;
  570.                                     }
  571.                                     break;
  572.                                  case 4:
  573.                                     if(ai_sost != 9 || move_snow_ball)
  574.                                     {
  575.                                        _X = _X - speed;
  576.                                        _Y = _Y - speed;
  577.                                        move_snow_ball = false;
  578.                                     }
  579.                               }
  580.                            }
  581.                         }
  582.                      }
  583.                   }
  584.                   else if(_X >= 781)
  585.                   {
  586.                      if(ai_sost != 9)
  587.                      {
  588.                         ai_sost = 2;
  589.                         turn_count = max_turn_count;
  590.                      }
  591.                   }
  592.                   else if(_Y < 0)
  593.                   {
  594.                      sost = 3;
  595.                   }
  596.                   else
  597.                   {
  598.                      var found_monster = false;
  599.                      if(_level0.pole[Math.floor((_Y + 28 - speed) / 40)][Math.floor((_X + 6 + speed) / 40)] == 3)
  600.                      {
  601.                         dy = - speed;
  602.                      }
  603.                      else if(_level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X + 6 + speed) / 40)] == 3)
  604.                      {
  605.                         dy = - speed;
  606.                      }
  607.                      else if(_level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X + 6 + speed) / 40)] == 4)
  608.                      {
  609.                         dy = speed;
  610.                      }
  611.                      else
  612.                      {
  613.                         dy = 0;
  614.                      }
  615.                      var i = 1;
  616.                      while(i <= _level0.num_monsters)
  617.                      {
  618.                         if(eval("_level0.monster" + i) != undefined && "/monster" + i != _target)
  619.                         {
  620.                            if(eval("_level0.monster" + i).sost != 8 && eval("_level0.monster" + i).sost != 9 && eval("_level0.monster" + i).sost != 10 && (_Y + 28 + dy >= eval("_level0.monster" + i)._y - 11 && _Y - 11 + dy <= eval("_level0.monster" + i)._y + 28) && !(eval("_level0.monster" + i).ai_sost == 9 && !eval("_level0.monster" + i).snow_ball))
  621.                            {
  622.                               right = false;
  623.                               left = false;
  624.                               if(_X + 10 + speed >= eval("_level0.monster" + i)._x - 27 && _X + 10 <= eval("_level0.monster" + i)._x - 27)
  625.                               {
  626.                                  right = true;
  627.                               }
  628.                               if(_X - 12 >= eval("_level0.monster" + i)._x + 25 && _X - 12 - speed <= eval("_level0.monster" + i)._x + 25)
  629.                               {
  630.                                  left = true;
  631.                               }
  632.                               if(right || left)
  633.                               {
  634.                                  if(ai_sost != 9 && ai_sost != 2 && right)
  635.                                  {
  636.                                     ai_sost = 2;
  637.                                     turn_count = max_turn_count;
  638.                                     found_monster = true;
  639.                                     break;
  640.                                  }
  641.                               }
  642.                            }
  643.                         }
  644.                         i++;
  645.                      }
  646.                      if(!found_monster)
  647.                      {
  648.                         if(_level0.pole[Math.floor((_Y + 28 - speed) / 40)][Math.floor((_X + 6 + speed) / 40)] == 3 || _level0.pole[Math.floor((_Y + 28) / 40)][Math.floor((_X + 6) / 40)] == 3)
  649.                         {
  650.                            if(ai_sost != 9 || move_snow_ball)
  651.                            {
  652.                               _X = _X + speed;
  653.                               _Y = _Y - speed;
  654.                               move_snow_ball = false;
  655.                            }
  656.                         }
  657.                         else
  658.                         {
  659.                            cx = Math.floor((_X + 6 + speed) / 40);
  660.                            cy = Math.floor((_Y + 28) / 40);
  661.                            switch(_level0.pole[cy][cx])
  662.                            {
  663.                               case 0:
  664.                               case 1:
  665.                                  if(ai_sost != 9 || move_snow_ball)
  666.                                  {
  667.                                     if(_level0.pole[Math.floor((_Y + 28 + speed) / 40)][Math.floor((_X - 8) / 40)] == 4)
  668.                                     {
  669.                                        _Y = _Y + speed;
  670.                                     }
  671.                                     _X = _X + speed;
  672.                                     move_snow_ball = false;
  673.                                  }
  674.                                  jump_side = false;
  675.                                  break;
  676.                               case 2:
  677.                                  if(ai_sost != 9)
  678.                                  {
  679.                                     if(cy >= 2 && sost != 2 && (_level0.pole[cy - 1][cx] == 0 || _level0.pole[cy - 2][cx] == 0) && (random(2) == 0 || _level0.hero.sost != 3 && Math.round((_level0.hero._y + 28) / 40) + 1 < cy))
  680.                                     {
  681.                                        if(_currentframe < frame_jump || _currentframe > frame_jump_last)
  682.                                        {
  683.                                           gotoAndPlay(frame_jump);
  684.                                        }
  685.                                        jump_index = 0;
  686.                                        sost = 2;
  687.                                        jump_side = true;
  688.                                     }
  689.                                     else if(!jump_side)
  690.                                     {
  691.                                        ai_sost = 2;
  692.                                        turn_count = max_turn_count;
  693.                                     }
  694.                                  }
  695.                                  break;
  696.                               case 3:
  697.                                  if(ai_sost != 9 || move_snow_ball)
  698.                                  {
  699.                                     _X = _X + speed;
  700.                                     _Y = _Y - speed;
  701.                                     move_snow_ball = false;
  702.                                  }
  703.                                  break;
  704.                               case 4:
  705.                                  if(ai_sost != 9 || move_snow_ball)
  706.                                  {
  707.                                     _X = _X + speed;
  708.                                     _Y = _Y + speed;
  709.                                     move_snow_ball = false;
  710.                                  }
  711.                            }
  712.                         }
  713.                      }
  714.                   }
  715.                }
  716.                if(sost == 1 && (ai_sost == 1 || ai_sost == 3) && (Math.round((_level0.hero._y + 28) / 40) + 1 < Math.round((_Y + 28) / 40) && (_level0.hero.sost != 3 && _level0.hero.sost != 4 && _level0.hero.sost != 9 && _level0.hero.sost != 10) || random(64) == 0 && ai_sost == 1 && Math.round((_Y + 28) / 40) > 2) && _level0.pole[Math.floor((_Y - 13) / 40)][Math.floor(_X / 40)] == 1)
  717.                {
  718.                   if(_currentframe < frame_jump || _currentframe > frame_jump_last)
  719.                   {
  720.                      gotoAndPlay(frame_jump);
  721.                   }
  722.                   jump_index = 0;
  723.                   sost = 2;
  724.                }
  725.                else if(plus_mode && sost == 1 && (ai_sost == 1 || ai_sost == 3) && (random(32) == 0 || random(8) == 0 && Math.round((_level0.hero._y + 28) / 40) > Math.round((_Y + 28) / 40) + 1) && Math.floor((_Y + 29) / 40) < 12 && _level0.pole[Math.floor((_Y + 29) / 40)][Math.floor(_X / 40)] != 0)
  726.                {
  727.                   if(_currentframe < frame_jumpdown || _currentframe > frame_jumpdown_last)
  728.                   {
  729.                      gotoAndPlay(frame_jumpdown);
  730.                   }
  731.                   jump_index = 3;
  732.                   sost = 2;
  733.                   jumpdown = true;
  734.                   jumpdownend = false;
  735.                }
  736.                else if(plus_mode && sost == 1 && (ai_sost == 1 || ai_sost == 3))
  737.                {
  738.                   if(_xscale > 0 && Math.floor(_X / 40) < 19)
  739.                   {
  740.                      if(_level0.pole[Math.floor((_Y + 29) / 40)][Math.floor((_X - 14 - speed) / 40)] != 0 && _level0.pole[Math.floor((_Y + 29) / 40)][Math.floor((_X - 14 - speed) / 40) + 1] == 0 && random(6) == 0)
  741.                      {
  742.                         if(_level0.hero._x < _X && (_level0.hero.sost != 4 && _level0.hero.sost != 9 && _level0.hero.sost != 10))
  743.                         {
  744.                            ai_sost = 2;
  745.                            turn_count = max_turn_count;
  746.                         }
  747.                      }
  748.                   }
  749.                   else if(_xscale < 0 && Math.floor(_X / 40) > 0)
  750.                   {
  751.                      if(_level0.pole[Math.floor((_Y + 29) / 40)][Math.floor((_X + 12 + speed) / 40)] != 0 && _level0.pole[Math.floor((_Y + 29) / 40)][Math.floor((_X + 12 + speed) / 40) - 1] == 0 && random(6) == 0)
  752.                      {
  753.                         if(_level0.hero._x > _X && (_level0.hero.sost != 4 && _level0.hero.sost != 9 && _level0.hero.sost != 10))
  754.                         {
  755.                            ai_sost = 2;
  756.                            turn_count = max_turn_count;
  757.                         }
  758.                      }
  759.                   }
  760.                }
  761.                if(sost == 1)
  762.                {
  763.                   if(ai_sost == 1)
  764.                   {
  765.                      if(_currentframe < frame_walk || _currentframe > frame_walk_last)
  766.                      {
  767.                         gotoAndPlay(frame_walk);
  768.                      }
  769.                      if(random(256) == 0)
  770.                      {
  771.                         ai_sost = 3;
  772.                         stand_count = max_stand_count;
  773.                      }
  774.                   }
  775.                }
  776.                break;
  777.             case 2:
  778.                if(_currentframe < frame_turn || _currentframe > frame_turn_last)
  779.                {
  780.                   gotoAndPlay(frame_turn);
  781.                }
  782.                if(turn_count > 0)
  783.                {
  784.                   turn_count--;
  785.                }
  786.                else
  787.                {
  788.                   ai_sost = 1;
  789.                   _xscale = - _xscale;
  790.                }
  791.                break;
  792.             case 3:
  793.                if(_currentframe < frame_stand || _currentframe > frame_stand_last)
  794.                {
  795.                   gotoAndPlay(frame_stand);
  796.                }
  797.                if(stand_count > 0)
  798.                {
  799.                   stand_count--;
  800.                }
  801.                else
  802.                {
  803.                   ai_sost = 1;
  804.                }
  805.                break;
  806.             case 8:
  807.                if(_currentframe < frame_wet || _currentframe > frame_wet_last)
  808.                {
  809.                   gotoAndPlay(frame_wet);
  810.                }
  811.                if(wet_count > 0)
  812.                {
  813.                   wet_count--;
  814.                }
  815.                else
  816.                {
  817.                   ai_sost = 1;
  818.                }
  819.          }
  820.          if((sost == 1 || sost == 2 || sost == 3) && (ai_sost == 1 || ai_sost == 2 || ai_sost == 3))
  821.          {
  822.             if(_xscale > 0)
  823.             {
  824.                var dx = 12;
  825.             }
  826.             else
  827.             {
  828.                var dx = -12;
  829.             }
  830.             if(!_level0.hero.immortal && (_level0.hero.sost == 1 || _level0.hero.sost == 2 || _level0.hero.sost == 3) && (_X + dx >= _level0.hero._x - 27 && _X + dx <= _level0.hero._x + 25) && (_Y + 28 >= _level0.hero._y - 8 && _Y - 16 <= _level0.hero._y + 28))
  831.             {
  832.                _level0.hero.sost = 9;
  833.                _level0.hero.death_index = 0;
  834.                _level0.hero._xscale = _xscale;
  835.                _level0.hero.gotoAndPlay(_level0.hero.frame_death);
  836.             }
  837.          }
  838.       }
  839.    }
  840. }
  841.